package com.polytech.diploma.SQLGenerator.Oracle.Functions;

import java.util.List;
import java.util.Map;

import com.polytech.diploma.SQLGenerator.Oracle.Arguments.Argument;

public class Function implements Argument, Expression{
	
	protected FunctionType type;
	protected List<Argument> argList = null;
	
	public Function() {
		super();
	}

	public Function(FunctionType type, List<Argument> argList) {
		super();
		this.type = type;
		this.argList = argList;
	}

	public FunctionType getType() {
		return type;
	}

	public void setType(FunctionType type) {
		this.type = type;
	}

	public List<Argument> getArgList() {
		return argList;
	}

	public void setArgList(List<Argument> argList) {
		this.argList = argList;
	}

	@Override
	public Map<String, List<String>> getTablesWithFields(Map<String, List<String>> fieldMap) {
		if(argList != null)
			for(Argument arg : argList)
			{
				fieldMap = arg.getTablesWithFields(fieldMap);
			}
		
		return fieldMap;
	}
	
	
}
